import React, { PureComponent } from 'react'
class MyButton extends PureComponent {
  render () {
    return (
      <>
         <button>按钮</button> { this.props.theme }
      </>
    )
  }
}

class ToolBar extends PureComponent {
  render () {
    return (
      <MyButton theme = { this.props.theme }></MyButton>
    )
  }
}

export default class App extends PureComponent {
  state = { theme: 'dark'}
  render() {
    return (
      <div>
        <ToolBar theme = { this.state.theme }/>
      </div>
    )
  }
}

